package com.itany.service.impl;

import com.itany.entity.Area;
import com.itany.mapper.AreaMapper;
import com.itany.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class AreaServiceImpl implements AreaService {
    @Autowired
    private AreaMapper mapper;

    @Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
    public Area findById(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }
}
